/**
 *
 */
package de.cbf.cam.dsa.item.model.entities;

import java.util.ArrayList;
import java.util.List;

import de.cbf.cam.dsa.item.model.entities.interfaces.IGarment;
import de.cbf.cam.dsa.item.model.entities.interfaces.IGenderSpecific;

/**
 * @author salter
 */
public class Garment extends Item implements IGarment,Comparable<Garment>{

	public static final int PI_LAYER 				=  100;
	public static final int PI_LAYER_SHIFT_INDEX	=  101;
	public static final int PI_COVERED_WEAR_PLACES	=  102;
	public static final int PI_SUITABLE_GENDER		=  103;

	public static final String PN_LAYER 				= "layer";
	public static final String PN_LAYER_SHIFT_INDEX		= "layer.shift.index";
	public static final String PN_COVERED_WEAR_PLACESN 	= "places.wear.covered";
	public static final String PN_SUITABLE_GENDER		= "gender.suitable";

	protected Double layer;
	/**
	 * if collision occurs shift layer by this amount
	 */
	protected Double layerShiftIndex;

	protected List<String> coveredWearPlaces;

	/** integer for suiting gender
	 */
	protected int suitableGender;

	public Garment(String name) {
		super(name);
	}

	@Override
	protected void init() {
		super.init();
		coveredWearPlaces = new ArrayList<String>();
		layer = 0D;
		layerShiftIndex = 0D;
		suitableGender = IGenderSpecific.GENDER_UNKNOWN;//suits all genders
	}

	@Override
	public int compareTo(Garment other) {
		if(layer.equals(other.layer)){
			return 0;
		}
		if(layer > other.layer){
			return 1;
		}
		return -1;
	}

	public Double getLayer() {
		return layer;
	}

	public void setLayer(Double layer) {
		this.layer = layer;
	}

	public List<String> getCoveredWearPlaces() {
		return coveredWearPlaces;
	}

	public void addWearPlace(String wearPlace){
		coveredWearPlaces.add(wearPlace);
	}

	public void removeWearPlace(String wearPlace){
		coveredWearPlaces.remove(wearPlace);
	}

	public void setCoveredWearPlaces(List<String> coveredWearPlaces) {
		this.coveredWearPlaces = coveredWearPlaces;
	}

	public int getGender() {
		return suitableGender;
	}

	public void setGender(int suitableGender) {
		this.suitableGender = suitableGender;
	}

	public Double getLayerShiftIndex() {
		return layerShiftIndex;
	}

	public void setLayerShiftIndex(Double layerShiftIndex) {
		this.layerShiftIndex = layerShiftIndex;
	}




}
